<template>
<!--    跑马灯-->
    <div class="line_box">
        <van-notice-bar
                left-icon="volume-o"
                mode="closeable"
                scrollable
        >{{msg}}</van-notice-bar>

    </div>
</template>

<script>

    import {getWeather} from "../../api/GoodNews";
    export default {
        name: "RunHourse",
        data(){
            return{
                msg:'',
            }

        },
        created() {
            // 获取天气接口请求
            getWeather(393,'4ffc69b0e870ca2976abd5d8b96a0a40').then(res=>{

                if (res.error_code==0 ){
                    this.msg = '今天是'+res.result.future[0].date+',气温：'+res.result.future[0].temperature+',风向'+res.result.future[0].direct+',天气情况:'+res.result.future[0].weather
                }
                else if (res.error_code ==10012 ){
                    this.msg = res.reason
                }

            })
        },
        methods: {


        },
    }
</script>

<style scoped lang="less">
    .line_box{
        background-color: #fffbe8;
    .line{
        width: 95%;
        margin: 0 auto;
        overflow: hidden;
        white-space: nowrap;
        height: 30px;
        line-height: 30px;
        color: #FD7304;
    }
    }

</style>